//logs.js
const app = getApp()
Page({
  data: {
  	language:'',
    company:{title:'',logo:'',type:'',address:'',phone:'',website:''},
    imageUrl:app.globalData.imageUrl,
  },
  onLoad: function(value) {
    this.setData({
      language:app.globalData.lang
    });
    var that = this;
    wx.request({
      url:app.globalData.url+'ciie/buyer/detail',
      method:'POST',
      data:{id:value.id,language:that.data.language},
      success:function(res){
        console.log(res);
        that.setData({
          company:res.data.data
        });
      }
    });
  },
  openWeb:function(e){
  	console.log(e);
  	wx.navigateTo({
  		url:'/pages/h5/index?url='+e.currentTarget.dataset.url
  	})
  },
  callPhone:function(e){
  	wx.makePhoneCall({
  		phoneNumber:e.currentTarget.dataset.phone
  	})
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var that = this;
    return {
      title: app.globalData.shareTitle,
      path: app.globalData.sharePath,
      imageUrl: '../../../images/share_img.png',
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
})